package routers

import (
	"github.com/gin-gonic/gin"
)

func RouterStart() *gin.Engine {

	//_, _ := exec.Command("ipconfig").Output() //执行shell命令

	//创建路由
	engine := gin.Default()
	//切换全局中间件为局部中间件
	//engine.Use(middleware.JwtTokenMiddleware()) //注入jwt权限验证 以及 过滤网站需要验证的模块
	//engine.Use(middleware.LoggerToFile())       //注入记录访问的日志

	//engine.StaticFS("/image",http.Dir("./static/upload/image")) 映射 将文件夹./static/upload/image 下的文件映射到 /image下
	//engine.StaticFile("/image", "./images/1.jpg") 文件直接映射
	//访问直接 http://127.0.0.1:8088/image/test.jpg
	AdminRouter(engine) //加载后台的api接口
	ApiRouter(engine)   //加载api路由
	return engine
}
